<template>
  <div class="footer">
    <slot>
      <span></span>
    </slot>
    <el-pagination
      :current-page.sync="currentNum"
      :page-size="20"
      @current-change="updatePageNum"
      layout="total, prev, pager, next"
      :total="60"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  name: 'Pagination',
  props: {
    getTableData: {
      type: Function,
    },
  },
  data() {
    return {
      currentNum: 1,
    };
  },
  methods: {
    updatePageNum() {
      this.getTableData();
      console.log('页码改变');
    },
  },
};
</script>

<style lang="less" scoped>
.footer {
  height: 60px;
  box-sizing: border-box;
  background-color: #ffffff;
  z-index: 101;
  box-shadow: 0 -2px 5px #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
